﻿//----------------------------------------------------------------
// Desc: INI文件读取
// Edit: ShowLong, http://blog.csdn.net/showlong
//
// Date Created: 2011-04-18
//
// Update Date : 
//
// Copyright (c) Fuel4D (http://www.fuel4d.com), All rights reserved.
//
//----------------------------------------------------------------
#pragma once


FINLINE bool IFINI::Open (const NCHAR* filename)
{
#ifdef UNICODE
    return OpenW(filename);
#else
    return OpenA(filename);
#endif
}

FINLINE const NCHAR* IFINI::GetFilename ()
{
#ifdef UNICODE
    return GetFilenameW();
#else
    return GetFilenameA();
#endif
}

FINLINE bool IFINI::OpenMuster (const NCHAR* name)
{
#ifdef UNICODE
    return OpenMusterW(name);
#else
    return OpenMusterA(name);
#endif
}

FINLINE const NCHAR* IFINI::GetCurMusterName ()
{
#ifdef UNICODE
    return GetCurMusterNameW();
#else
    return GetCurMusterNameA();
#endif
}

FINLINE IFINI::ITEM* IFINI::HasKey (const NCHAR* name)
{
#ifdef UNICODE
    return HasKeyW(name);
#else
    return HasKeyA(name);
#endif
}

FINLINE const NCHAR* IFINI::GetString(const NCHAR* name)
{
#ifdef UNICODE
    return GetStringW(name);
#else
    return GetStringA(name);
#endif
}

FINLINE bool IFINI::GetBool (const NCHAR* name)
{
#ifdef UNICODE
    return GetBoolW(name);
#else
    return GetBoolA(name);
#endif
}

FINLINE bool IFINI::GetBoolA(const ACHAR* name)
{
    return GetBoolW(FStringW(name));
}

FINLINE int IFINI::GetInt (const NCHAR* name)
{
#ifdef UNICODE
    return GetIntW(name);
#else
    return GetIntA(name);
#endif
}

FINLINE int IFINI::GetIntA(const ACHAR* name)
{
    return GetIntW(FStringW(name));
}

FINLINE float IFINI::GetFloat (const NCHAR* name)
{
#ifdef UNICODE
    return GetFloatW(name);
#else
    return GetFloatA(name);
#endif
}

FINLINE float IFINI::GetFloatA(const ACHAR* name)
{
    return GetFloatW(FStringW(name));
}

FINLINE DWORD IFINI::GetColor (const NCHAR* name)
{
#ifdef UNICODE
    return GetColorW(name);
#else
    return GetColorA(name);
#endif
}

FINLINE DWORD IFINI::GetColorA(const ACHAR* name)
{
    return GetColorW(FStringW(name));
}

FINLINE POINT IFINI::GetPoint (const NCHAR* name)
{
#ifdef UNICODE
    return GetPointW(name);
#else
    return GetPointA(name);
#endif
}

FINLINE POINT IFINI::GetPointA(const ACHAR* name)
{
    return GetPointW(FStringW(name));
}

FINLINE RECT IFINI::GetRect (const NCHAR* name)
{
#ifdef UNICODE
    return GetRectW(name);
#else
    return GetRectA(name);
#endif
}

FINLINE RECT IFINI::GetRectA(const ACHAR* name)
{
    return GetRectW(FStringW(name));
}

FINLINE FRect IFINI::GetFRect (const NCHAR* name)
{
#ifdef UNICODE
    return GetFRectW(name);
#else
    return GetFRectA(name);
#endif
}

FINLINE FRect IFINI::GetFRectA(const ACHAR* name)
{
    return GetFRectW(FStringW(name));
}

FINLINE const NCHAR* IFINI::GetCurMusterItemName (int index)
{
#ifdef UNICODE
    return GetCurMusterItemNameW(index);
#else
    return GetCurMusterItemNameA(index);
#endif
}

FINLINE const NCHAR* IFINI::GetCurMusterItemValue (int index)
{
#ifdef UNICODE
    return GetCurMusterItemValueW(index);
#else
    return GetCurMusterItemValueA(index);
#endif
}